<?php

/*---------------------------------------------------------------------------
 * Please, don't touch this file.
 *
 * If you need to custom this Class, you can edit campaign.php
 * file overwrite and define new methods
 *---------------------------------------------------------------------------
 */

/**
 * 
 *
 * @Authors Gonzalez Federico, Viera Leonel 
 * @package mailing
 * @subpackage model
 *
 * 
 */
class Campaign_protoweb extends Protoweb_models {
  public $table      = "campaigns";
  public $model      = "campaign";
  public $has_many   = array('send');
  public $has_one    = array('client', 'template');
  public $validation = array(
    'subject' => array(
      'label' => 'Subject',
      'rules' => array('trim', 'required')      
    ),
    'created' => array(
      'label' => 'Create date',
      'rules' => array('required', 'valid_date')
          
    ),
    'filters' => array(
      'label' => 'Filters',
      'rules' => array('trim')
          
    ),
    'from' => array(
      'label' => 'From',
      'rules' => array('trim', 'required', 'valid_email')
          
    ),
    'name' => array(
      'label' => 'Name',
      'rules' => array('trim', 'required')
          
    ),
    'body' => array(
      'label' => 'Body',
      'rules' => array()
          
    ),
    'sent' => array(
      'label' => 'Start sending date',
      'rules' => array('valid_date')
          
    ),
    'tplbody' => array(
      'label' => 'Template Body',
      'rules' => array('trim', 'required')
          
    ),
    'shipment' => array(
      'label' => 'Completion Date of Shipment',
      'rules' => array('valid_date')
    )
  ); // $validation
  

  public function __construct($id = NULL) {
    parent::__construct($id);
  } // end of method __construct($id = NULL)

} // Class Campaign_protoweb

/* End of file Campaign_protoweb.php */
/* Location: ./system/application/models/Campaign_protoweb.php */